<template>

  <el-dialog
    :title="dialogStatus"
    :visible.sync="dialogFormVisible"
    width="70%">
    <el-form
      ref="dataForm"
      :rules="rules"
      :model="Form"
      label-width="160px" >
      <h1 style="text-align: center">产品详情</h1>

      <el-form-item
        :label="$t('product.productType')"
        prop="productType"

      >
        <el-select
          v-model="Form.productType"
          class="filter-item">
          <el-option
            v-for="item in productTypeList"
            :key="item.value"
            :label="item.value"
            :value="item.value"/>
        </el-select>
      </el-form-item>

      <el-form-item
        :label="$t('product.name')"
        prop="name">
        <el-input v-model="Form.name"/>
      </el-form-item>

      <el-form-item
        :label="$t('product.beginMoney')"
        prop="beginMoney">
        <el-input
          v-model.number="Form.beginMoney"
          :min="0"
          type="number"/>
      </el-form-item>

      <el-form-item
        :label="$t('product.investDirection')"
        prop="investDirection">
        <el-input v-model="Form.investDirection"/>
      </el-form-item>

      <el-form-item
        :label="$t('product.raiseScale')"
        prop="raiseScale">
        <el-input
          v-model.number="Form.raiseScale"
          :min="0"
          type="number"/>
      </el-form-item>

      <el-form-item
        :label="$t('product.manageRate')"
        prop="manageRate">
        <el-input
          v-model.number="Form.manageRate"
          :min="0"
          type="number"/>
      </el-form-item>

      <el-form-item
        :label="$t('product.commissionRate')"
      >
        <!--   prop="commissionRate" -->
        <div class="rowbox">
          <el-row v-for="(item,index) in Form.commissionRate" :gutter="20" :key="index" class="commissionRaterow">
            <el-col :span="2" style="text-align:right;">
              区间:
            </el-col>
            <el-col :span="3">
              <el-form-item
                :prop="'commissionRate.'+ index + '.begin'"
              >
                <el-input v-model.number="item.begin" :min="0" type="number"/>
              </el-form-item>
            </el-col>
            <el-col :span="1" class="textent">
              ~
            </el-col>
            <el-col :span="3">
              <el-form-item v-show="!item.gigantic">
                <el-input v-model.number="item.end" :min="0" type="number"/>
              </el-form-item>
            </el-col>
            <el-col :span="3">
              <el-checkbox v-model="item.gigantic">无穷大</el-checkbox>
            </el-col>

            <el-col :span="3" style="text-align:right;">
              佣金前端（%）:
            </el-col>
            <el-col :span="3">
              <el-form-item
                :prop="'commissionRate.'+ index + '.scale'"
              >
                <el-input v-model.number="item.scaleFront" :min="0" type="number"/>
              </el-form-item>
            </el-col>

            <el-col :span="3" style="text-align:right;">
              佣金后端（%）:
            </el-col>
            <el-col :span="3">
              <el-form-item>
                <el-input v-model.number="item.scaleBack" :min="0" type="number"/>
              </el-form-item>
            </el-col>
          </el-row>
        </div>

        <el-row class="Addcommission">
          <el-col :span="24">
            <el-button type="success" size="small" @click="Addcommission()">添加</el-button>
            <el-button type="danger" size="small" @click="Deletecommission()">删除</el-button>
          </el-col>
        </el-row>

      </el-form-item>

      <el-form-item
        :label="$t('product.commissionRateGp')"
        prop="commissionRateGp">
        <el-select
          v-model="Form.commissionRateGp"
          class="filter-item">
          <el-option
            v-for="(item,index) in commissionRateGpList"
            :key="index"
            :label="item.label"
            :value="item.value"/>
        </el-select>
      </el-form-item>

      <el-form-item
        :label="$t('product.nbCommissionRateGp')"
        prop="commissionRateGp">
        <el-select
          v-model="Form.nbCommissionRateGp"
          class="filter-item">
          <el-option
            v-for="(item,index) in commissionRateGpList"
            :key="index"
            :label="item.label"
            :value="item.value"/>
        </el-select>
      </el-form-item>

      <el-form-item
        :label="$t('product.yearEarningsRate')"
      >
        <!--  prop="yearEarningsRate" -->
        <div class="rowbox">
          <el-row v-for="(item,index) in Form.yearEarningsRate" :gutter="20" :key="index" class="commissionRaterow">
            <el-col :span="2" style="text-align:right;">
              区间:
            </el-col>
            <el-col :span="4">
              <el-form-item
                :prop="'yearEarningsRate.'+ index + '.begin'"
                :rules="rules.yearEarningsRate.begin"
              >
                <el-input v-model.number="item.begin" :min="0" type="number"/>
              </el-form-item>

            </el-col>
            <el-col :span="1" class="textent">
              ~
            </el-col>
            <el-col :span="4">
              <el-form-item
                :prop="'yearEarningsRate.'+ index + '.end'"
                :rules="rules.yearEarningsRate.end"
              >
                <el-input v-model.number="item.end" :min="0" type="number"/>
              </el-form-item>

            </el-col>
            <el-col :span="4" style="text-align:right;">
              收益率:
            </el-col>
            <el-col :span="5">
              <el-form-item
                :prop="'yearEarningsRate.'+ index + '.scale'"
                :rules="rules.yearEarningsRate.scale"
              >
                <el-input v-model.number="item.scale" :min="0" type="number"/>
              </el-form-item>

            </el-col>
            <el-col :span="1">
              %
            </el-col>
          </el-row>
        </div>

        <el-row class="Addcommission">
          <el-col :span="24">
            <el-button type="success" size="small" @click="AddyearEarningsRate()">添加</el-button>
            <el-button type="danger" size="small" @click="DeleteyearEarningsRate()">删除</el-button>
          </el-col>
        </el-row>

      </el-form-item>

      <h1 style="text-align: center">打款银行</h1>

      <el-form-item
        :rules="rules.bank.bankName"
        label="户名"
        prop="bank.bankName"
      >
        <el-input v-model="Form.bank.bankName"/>
      </el-form-item>

      <el-form-item
        :rules="rules.bank.bankNumber"
        label="账号"
        prop="bank.bankNumber"
      >
        <el-input v-model="Form.bank.bankNumber"/>
      </el-form-item>

      <el-form-item
        :rules="rules.bank.bankAdd"
        label="开户行"
        prop="bank.bankAdd"
      >
        <el-input v-model="Form.bank.bankAdd"/>
      </el-form-item>

      <el-form-item
        :rules="rules.bank.bankRemarks"
        label="备注"
        prop="bank.bankRemarks"
      >
        <el-input v-model="Form.bank.bankRemarks"/>
      </el-form-item>

      <h1 style="text-align: center">其它</h1>

      <el-form-item :label="$t('product.incomeExplain')">
        <el-input
          :autosize="{ minRows: 6, maxRows: 4}"
          v-model="Form.incomeExplain"
          type="textarea"/>
      </el-form-item>

      <el-form-item :label="$t('product.coreHighlights')">
        <el-input
          :autosize="{ minRows: 6, maxRows: 4}"
          v-model="Form.coreHighlights"
          type="textarea"/>
      </el-form-item>

      <el-form-item :label="$t('product.eduInfo')">
        <el-input
          :autosize="{ minRows: 6, maxRows: 4}"
          v-model="Form.eduInfo"
          type="textarea"/>
      </el-form-item>
      <el-alert
        v-if="loading"
        :closable="false"
        title="文件上传中请稍等.........."
        type="warning"
        center
      />
      <el-form-item label="产品相关资料:">
        <el-upload
          :action="apibase + '/admin/ajax/upload'"
          :on-success="handleAvatarSuccess"
          :on-error="handleAvatarError"
          :on-remove="handleAvatarRemove"
          :before-upload="beforeAvatarUpload"
          :file-list="Form.pdflist"
          class="product-upload-pdf">
          <div
            slot="tip"
            class="el-upload__tip">请上传pdf，且不超过100m</div>
          <el-button
            size="small"
            type="primary">点击上传</el-button>
        </el-upload>
      </el-form-item>

      <el-form-item
        :label="$t('product.progress')"
        style="margin-top: 50px">
        <!--<progress-bar :min="0" :max="100" v-model="Form.per"/>-->
        <template>
          <div class="block">
            <el-slider
              v-model="Form.per"
              show-input/>
          </div>
        </template>
        <el-input
          :autosize="{ minRows: 6, maxRows: 100}"
          v-model="Form.scheduleList.detail"
          style="margin-top: 30px"
          type="textarea"/>
      </el-form-item>

      <el-form-item label="项目分期">
        <el-row>
          <el-col :span="24">
            <el-button
              type="success"
              size="small"
              @click="sonProductAdd()">添加</el-button>
          </el-col>
        </el-row>
      </el-form-item>

      <el-form-item >
        <el-row
          v-for="(item,index) of Form.sonProductList"
          :key="index"
          style="padding-bottom: 30px;border-bottom:1px dotted #F5DEB3;">
          <el-row class="col-mtop">
            <el-col :span="19">
              <el-form-item
                :prop="'sonProductList.'+ index + '.name'"
                :rules="rules.fq.name">
                <el-input
                  v-model="item.name"
                  placeholder="分期名称"/>
              </el-form-item>
            </el-col>
            <el-col
              :span="3"
              style="padding-left: 15px">
              <i
                class="el-icon-delete"
                style="font-size: 20px;cursor:pointer;color: red"
                @click="sonProductDel(index)"/>
            </el-col>
          </el-row>
          <el-row class="col-mtop">
            <el-col
              :span="3"
              class="fq-span">成立时间</el-col>
            <el-col :span="9">
              <el-form-item
                :prop="'sonProductList.'+ index + '.clTime'"
                :rules="rules.fq.clTime">
                <el-date-picker
                  v-model="item.clTime"
                  style="width: 100%"
                  type="date"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="成立时间"
                />
                <!-- @input="jsNextPayRateTime(index)" -->
              </el-form-item>
            </el-col>
            <el-col
              :span="3"
              class="fq-span">到期时间</el-col>
            <el-col :span="9" >
              <el-form-item
                :prop="'sonProductList.'+ index + '.endTime'"
                :rules="rules.fq.endTime">
                <el-date-picker
                  v-model="item.endTime"
                  style="width: 100%"
                  type="date"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="到期时间"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row class="col-mtop">
            <el-col
              :span="3"
              class="fq-span">付息方式</el-col>
            <el-col :span="9">
              <el-form-item
                :prop="'sonProductList.'+ index + '.payRateWay'"
                :rules="rules.fq.payRateWay">
                <el-select
                  v-model="item.payRateWay"
                  style="width: 100%"
                  class="filter-item"
                  placeholder="付息方式"
                >
                  <!--  @input="jsNextPayRateTime(index)" -->
                  <el-option
                    v-for="(item2,index) in payRateWayList"
                    :key="index"
                    :value="item2"/>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col
              :span="3"
              class="fq-span">付息日</el-col>
            <el-col :span="9">
              <el-row>
                <el-col v-for="(item1 ,index1) in item.payRateTime" :key="index1" class="PayRatebox">
                  <el-form-item>
                    <!--  :prop="'sonProductList['+ index +']['+index1+']PayTime'"
                    :rules="rules.fq.payRateTime" -->
                    <el-date-picker
                      v-model="item1.PayTime"
                      style="width: 100%"
                      type="date"
                      value-format="yyyy-MM-dd HH:mm:ss"
                      placeholder="付息日"/>
                  </el-form-item>
                </el-col>

              </el-row>
            </el-col>
          </el-row>
          <el-row class="Addbox">
            <el-col :span="6" :offset="18">
              <el-button type="success" size="small" @click="AddPayRateTime(index)">添加</el-button>
              <el-button type="danger" size="small" @click="DeletePayRateTime(index)">删除</el-button>
            </el-col>
          </el-row>
        </el-row>
      </el-form-item>

      <el-form-item label="项目是否在售">
        <template>
          <el-row>
            <el-col :span="12">
              <el-radio
                v-model="Form.productStatus"
                :label="2">是</el-radio>
              <el-radio
                v-model="Form.productStatus"
                :label="1">否</el-radio>
            </el-col>
          </el-row>
        </template>
      </el-form-item>

      <el-form-item
        v-if="dialogStatus.indexOf('编辑') != -1"
        label="通知产品更新">
        <el-checkbox v-model="Form.notice"/>
      </el-form-item>

      <el-form-item label="权重">
        <el-input
          v-model.number="Form.weigh"
          :min="0"
          type="number"/>
      </el-form-item>

    </el-form>
    <div
      slot="footer"
      class="dialog-footer">
      <el-button @click="dialogFormVisible = false">{{ $t('product.cancel') }}</el-button>
      <el-button
        type="primary"
        @click="dialogStatus.indexOf('编辑') == -1?createData():updateData()">{{ $t('product.confirm') }}</el-button>
    </div>
  </el-dialog>
</template>

<script>

import { apibase, add, edit, fetch, jsNextPayRateTime, delProduct } from '@/api/product'
import ProgressBar from '@/components/Progress'

export default {
  name: 'Jjform',
  components: {
    ProgressBar
  },
  filters: {
    showMoney: function(status) {
      return status / 1000000
    }
  },
  data() {
    return {
      loading: false,
      dialogStatus: '',
      apibase: apibase,
      addLoading: false,
      dialogFormVisible: false,
      payRateWayList: [
        '按季付息',
        '半年付息',
        '按年付息',
        '到期付息',
        '自然季度付息',
        '自然半年度付息',
        '自然年度付息'
      ],
      commissionRateGpList: [
        {
          'value': 0,
          'label': '系数0-0%'
        },
        {
          'value': 1,
          'label': '系数1-20%'
        },
        {
          'value': 2,
          'label': '系数2-40%'
        },
        {
          'value': 3,
          'label': '系数3-60%'
        },
        {
          'value': 4,
          'label': '系数4-80%'
        },
        {
          'value': 5,
          'label': '系数5-100%'
        }
      ],
      Form: {
        id: '',
        productStatus: 1,
        weigh: 0,
        per: 0,
        name: '',
        beginMoney: '', // 认购起点
        investDirection: '', // 投资方向
        raiseScale: '', // 规模
        manageRate: '',
        yearEarningsRate: [
          {
            begin: '',
            end: '',
            scale: ''
          }
        ],
        commissionRate: [
          {
            begin: '',
            end: '',
            scaleFront: '',
            scaleBack: '',
            gigantic: false
          }
        ],
        nbCommissionRateGp: '',
        commissionRateGp: '',
        incomeExplain: '',
        moneyUseFor: '',
        coreHighlights: '',
        eduInfo: '',
        productType: '',
        productCategory: '',
        pdflist: [],
        notice: false,
        scheduleList:
          {
            detail: ''
          },
        sonProductList: [],
        bank: {
          bankName: '',
          bankNumber: '',
          bankAdd: '',
          bankRemarks: ''
        }
      },
      rules: {
        productType: [
          { required: true, message: '请输入产品来源', trigger: 'change' }
        ],
        name: [
          { required: true, message: '请输入产品名', trigger: 'blur' }
        ],
        raiseScale: [
          { required: true, message: '请输入规模', trigger: 'blur' },
          { type: 'number', message: '只能输入数字', trigger: 'blur' }
        ],
        beginMoney: [
          { required: true, message: '请输入起点', trigger: 'blur' },
          { type: 'number', message: '只能输入数字', trigger: 'blur' }
        ],
        manageRate: [
          { required: true, message: '请输入费率', trigger: 'blur' },
          { type: 'number', message: '只能输入数字', trigger: 'blur' }
        ],
        yearEarningsRate: {
          begin: [
            { required: true, message: '请输入开始金额' },
            { type: 'number', message: '只能输入数字' }
          ],
          end: [
            { required: true, message: '请输入结束金额' },
            { type: 'number', message: '只能输入数字' }

          ],
          scale: [
            { required: true, message: '请输入收益率' },
            { type: 'number', message: '只能输入数字' }
          ]
        },
        commissionRate: {
          begin: [
            { required: true, message: '请输入金额' },
            { type: 'number', message: '只能输入数字' }
          ],
          end: [
            { required: true, message: '请输入结束金额' },
            { type: 'number', message: '只能输入数字' }
          ],
          scale: [
            { required: true, message: '请输入收益率' },
            { type: 'number', message: '只能输入数字' }
          ]
        },
        bank: {
          bankName: [
            { required: true, message: '请输入户名', trigger: 'blur' }
          ],
          bankNumber: [
            { required: true, message: '请输入账号', trigger: 'blur' }
          ],
          bankAdd: [
            { required: true, message: '请输入开户行', trigger: 'blur' }
          ],
          bankRemarks: [
            { required: true, message: '请输入备注', trigger: 'blur' }
          ]
        },
        fq: {
          name: [
            { required: true, message: '请输入分期名', trigger: 'blur' }
          ],
          clTime: [
            { required: true, message: '请输入成立时间', trigger: 'blur' }
          ],
          endTime: [
            { required: true, message: '请输入到期时间', trigger: 'blur' }
          ],
          payRateTime: [
            { required: true, message: '请输入付息时间', trigger: 'blur' }
          ],
          payRateWay: [
            { required: true, message: '请输入付息方式', trigger: 'change' }
          ]
        }
      },
      productTypeList: [
        {
          value: '天赋集团'

        },
        {
          value: '其它'

        }
      ]
    }
  },
  watch: {
    Form: {
      handler(newValue, oldValue) {
        this.Form.commissionRate.forEach((item, index) => {
          if (item.gigantic) {
            item.end = 2000000
          } else {
            // item.end = '';
          }
        })
      },
      deep: true
    }
  },
  mounted() {

  },
  methods: {
    AddPayRateTime(index) {
      this.Form.sonProductList[index].payRateTime.push({ PayTime: '' })
    },
    DeletePayRateTime(index) {
      console.log(index)
      if (this.Form.sonProductList[index].payRateTime.length > 1) {
        this.Form.sonProductList[index].payRateTime.pop()
      } else {
        this.$message({
          showClose: true,
          message: '至少填写一个付息时间',
          type: 'error'
        })
      }
    },
    AddyearEarningsRate() {
      this.Form.yearEarningsRate.push(
        {
          begin: '',
          end: '',
          scale: ''
        }
      )
    },
    DeleteyearEarningsRate() {
      if (this.Form.yearEarningsRate.length > 1) {
        this.Form.yearEarningsRate.pop()
      } else {
        this.$message({
          showClose: true,
          message: '至少填写一种',
          type: 'error'
        })
      }
    },
    Addcommission() {
      this.Form.commissionRate.push(
        {
          begin: '',
          end: '',
          scale: '',
          scale1: '',
          gigantic: false
        }
      )
    },
    Deletecommission() {
      if (this.Form.commissionRate.length > 1) {
        this.Form.commissionRate.pop()
      } else {
        this.$message({
          showClose: true,
          message: '至少填写一种',
          type: 'error'
        })
      }
    },
    sonProductAdd: function() {
      var num = this.Form.sonProductList.length
      var name = this.Form.name + '(第' + (num + 1) + '期)'
      this.Form.sonProductList.push(
        { name: name, payRateWay: '', clTime: '', endTime: '', payRateTime: [{ PayTime: '' }], id: 0 }
      )
    },
    sonProductDel: function(index) {
      var id = this.Form.sonProductList[index].id
      if (id) {
        this.$confirm('确认删除吗?', '提示', {
          type: 'warning'
        }).then(() => {
          delProduct(id).then((res) => {
            if (res.data.code == 1) {
              this.Form.sonProductList.splice(index, 1)
            } else {
              this.$message({
                showClose: true,
                message: '该产品下已经有订单存在不能删除',
                type: 'error'
              })
            }
          }).catch((err) => {
            this.$message({
              showClose: true,
              message: '网络请求失败',
              type: 'error'
            })
          })
        }).catch(() => {

        })
      } else {
        this.Form.sonProductList.splice(index, 1)
      }
    },
    jsNextPayRateTime: function(index) {
      jsNextPayRateTime(this.Form.sonProductList[index]).then((res) => {
        if (res.data.code == 1) {
          // var milliseconds=Date.parse(res.data.data);
          // var dependedDate=new Date();
          // dependedDate.setTime(milliseconds);
          this.Form.sonProductList[index].payRateTime = res.data.data
        } else {
          this.$message({
            showClose: true,
            message: '自动计算付息日失败',
            type: 'error'
          })
          return
        }
      }).catch((err) => {
        this.$message({
          showClose: true,
          message: '自动计算付息日失败',
          type: 'error'
        })
        return
      })
    },
    createData: function() {
      this.$refs.dataForm.validate((valid) => {
        if (valid) {
          add(this.Form).then((res) => {
            if (res.data.code == 1) {
              this.dialogFormVisible = false
              this.$notify({
                title: '成功',
                message: '创建成功',
                type: 'success',
                duration: 2000
              })
              this.$emit('submit')
            } else {
              this.$notify.error({
                title: '错误',
                message: res.data.message
              })
              return
            }
          }).catch((err) => {
            this.$message({
              showClose: true,
              message: '网络请求失败',
              type: 'error'
            })
            return
          })
        } else {
          setTimeout(() => {
            var isError = document.getElementsByClassName('is-error')
            isError[0].querySelector('input').focus()
          }, 1)
          return false
        }
      })
    },
    updateData: function() {
      this.$refs.dataForm.validate((valid) => {
        if (valid) {
          edit(this.Form).then((res) => {
            if (res.data.code == 1) {
              this.dialogFormVisible = false
              this.$notify({
                title: '成功',
                message: '更新成功',
                type: 'success',
                duration: 2000
              })
              this.$emit('submit')
            } else {
              this.$notify.error({
                title: '错误',
                message: res.data.message
              })
              return
            }
          }).catch((err) => {
            this.$message({
              showClose: true,
              message: '网络请求失败',
              type: 'error'
            })
            return
          })
        } else {
          setTimeout(() => {
            var isError = document.getElementsByClassName('is-error')
            isError[0].querySelector('input').focus()
          }, 1)
          return false
        }
      })
    },
    formShow: function($row, $option, $type = 0) {
      this.dialogFormVisible = true
      // 编辑
      if ($type) {
        fetch($row).then(res => {
          if (res.data.code == 1) {
            this.Form = res.data.data
            console.log(res.data.data)
            this.Form.productCategory = $option
          } else {
            this.$message({
              showClose: true,
              message: '获取数据失败',
              type: 'error'
            })
          }
        }
        ).catch(() => {
          this.$message({
            showClose: true,
            message: '网络请求失败',
            type: 'error'
          })
        })
        this.dialogStatus = '编辑-' + $option
      } else {
        this.dialogStatus = '添加-' + $option

        this.Form = {
          id: '',
          productStatus: 1,
          weigh: 0,
          per: 0,
          name: '',
          beginMoney: '', // 认购起点
          investDirection: '', // 投资方向
          raiseScale: '', // 规模
          manageRate: '',
          yearEarningsRate: [
            {
              begin: '',
              end: '',
              scale: ''
            }
          ],
          commissionRate: [
            {
              begin: '',
              end: '',
              scale: '',
              scale1: '',
              gigantic: false
            }
          ],
          nbCommissionRateGp: '',
          commissionRateGp: '',
          incomeExplain: '',
          moneyUseFor: '',
          coreHighlights: '',
          eduInfo: '',
          productType: '',
          productCategory: '',
          pdflist: [],
          notice: false,
          scheduleList:
          {
            detail: ''
          },
          sonProductList: [],
          bank: {
            bankName: '',
            bankNumber: '',
            bankAdd: '',
            bankRemarks: ''
          }
        }
        this.Form.productCategory = $option
      }
    },

    // pdf 设置
    handleAvatarSuccess(response, file, fileList) {
      if (response.code == 1) {
        this.$message({
          showClose: true,
          message: response.msg,
          type: 'success'
        })
        this.Form.pdflist.push({ name: response.data.name, url: response.data.url, size: response.data.size })
        this.loading = false
      } else {
        this.$message({
          showClose: true,
          message: response.msg,
          type: 'error'
        })
        this.loading = false
        return
      }
    },
    handleAvatarError(err, file, fileList) {
      this.$message({
        showClose: true,
        message: '文件上传失败',
        type: 'error'
      })
      return
    },
    handleAvatarRemove(file, fileList) {
      this.Form.pdflist = this.Form.pdflist.filter(u => u.uid !== file.uid)
    },
    beforeAvatarUpload(file) {
      // const isJPG = file.type === 'application/pdf'
      const isJPG = true
      const isLt2M = file.size / 1024 / 1024 < 150
      if (!isJPG) {
        this.$message.error('上传文件只能是 PDF 格式!')
        return false
      }
      if (!isLt2M) {
        this.$message.error('上传文件大小不能超过 100MB!')
        return false
      }
      this.loading = true
      return isJPG && isLt2M
    }
  }
}
</script>

<style scoped>
  .scheduleInput{
    margin-bottom: 10px;
    margin-right: 30px;
  }
  .col-mtop{
    margin-top: 20px;
  }
  .fq-span{
    padding: 0 10px;
    font-size: 9px;
    line-height: 36px;
  }

  .commissionRaterow{
    margin-bottom: 20px;
  }
  .rowbox{
    overflow: hidden;
  }
  .Addbox{
    text-align: right;
  }
  .PayRatebox{
    margin-bottom: 10px;
  }
  .textent{
    text-align: center;
  }
</style>

